package com.tanhua.dubbo.api.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.domain.db.SoulQuestion;

import com.tanhua.dubbo.api.SoulQuestionApi;
import com.tanhua.dubbo.mapper.SoulQuestionMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class SoulQuestionApiImpl implements SoulQuestionApi {
    @Autowired
    private SoulQuestionMapper questionMapper;
    @Override
    public SoulQuestion selectById(int qid) {
        SoulQuestion soulQuestion = questionMapper.selectById(qid);
        return soulQuestion;
    }

    @Override
    public void updateById(SoulQuestion soulQuestion) {
        questionMapper.updateById(soulQuestion);
    }

    @Override
    public SoulQuestion selectOne(int sid, String question) {
        QueryWrapper wrapper1=new QueryWrapper();
        wrapper1.eq("sid",sid);
        wrapper1.eq("question",question);
        SoulQuestion soulQuestion = questionMapper.selectOne(wrapper1);
        return soulQuestion;
    }

    @Override
    public void insert(SoulQuestion soulQuestion) {
        questionMapper.insert(soulQuestion);
    }
}
